#ifndef UTILITY _H
#define UTILITY _H

#include <avr/pgmspace.h>
#include "WProgram.h"

#include <EEPROM.h>
#include <LiquidCrystal.h>
#include <Streaming.h>

extern char buffer[25];

const int LCD_LINES   = 4;
const int LCD_COLUMNS = 20;

const int NUMBER_OF_DOSING_PUMPS = 8;
const int NUMBER_OF_MODES = 8;

extern PROGMEM const char *days_names_table[];
extern PROGMEM const char *short_days_names_table[];

const int EEPROM_GEN_ADDRESS_START    = 0;
const int EEPROM_GEN_ADDRESS_LEN = 20;
const int EEPROM_TEMP_ADDRESS_START    = EEPROM_GEN_ADDRESS_START + EEPROM_GEN_ADDRESS_LEN;
const int EEPROM_TEMP_ADDRESS_LEN = 10;
const int EEPROM_AUTO_TOP_ADDRESS_START    =  EEPROM_TEMP_ADDRESS_START + EEPROM_TEMP_ADDRESS_LEN;
const int EEPROM_AUTO_TOP_ADDRESS_LEN = 10;
const int EEPROM_MODES_ADDRESS_START    =  EEPROM_AUTO_TOP_ADDRESS_START + EEPROM_AUTO_TOP_ADDRESS_LEN;
const int EEPROM_MODES_ADDRESS_OFFSET = 80;
const int EEPROM_MODES_ADDRESS_LEN = EEPROM_MODES_ADDRESS_OFFSET*8;
const int EEPROM_DOSING_PUMP_ADDRESS_START = EEPROM_MODES_ADDRESS_START + EEPROM_MODES_ADDRESS_LEN; 
const int EEPROM_DOSING_PUMP_ADDRESS_OFFSET = 80;
const int EEPROM_DOSING_PUMP_ADDRESS_LEN = EEPROM_DOSING_PUMP_ADDRESS_OFFSET*NUMBER_OF_DOSING_PUMPS;

const int EEPROM_DEVICE_ADDRESS_START = EEPROM_DOSING_PUMP_ADDRESS_START + EEPROM_DOSING_PUMP_ADDRESS_LEN;
const int EEPROM_DEVICE_ADDRESS_OFFSET = 100;

const int TEMP_STRING = 0;
const int Temp_STRING = 1;
const int FREE_MEMORY_STRING = 2;
const int PROBE_STRING = 3;
const int STIRRER_TIME_STRING  = 4;
const int ARE_YOU_SURE_STRING  = 5;
const int YES_NO_STRING  = 6;
const int Liquid_STRING  = 7;
const int Clear_History_STRING  = 8;
const int Prass_5_STRING  = 9;
const int MODE_STRING  = 10;
const int NO_ALERTS_STRING  = 11;
const int ALERTS_STRING  = 12;
const int YES_NO_STRING_2  = 13;
const int EMPTY_LINE  = 14;

  
extern PROGMEM const char *gen_string_table[];
  
void Print_Space();
void Print_Space(byte num);
void Print_Colon();
void Print_ON();
void Print_OFF();

void Reset_Memory();

#endif
